public enum PropertyType extends Enum<PropertyType> implements Type
Enum Constant and Description |
---|
BOOLEAN
Boolean type for properties
|
DATE
Date type for properties
|
DOUBLE
Double type for properties
|
EDGE
Edge type for properties
|
FLOAT
Float type for properties
|
INTEGER
Integer type for properties
|
LONG
Long type for properties
|
LONG_SET
Long set type for properties
|
RO_STRING_SET
String set type for properties
|
SPARSE
Sparse type for properties
|
STRING
String type for properties
|
VERTEX
Node type for properties
|
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
DEFAULT_DATE_FORMAT
Date format that is used to parse DATE objects
|
Modifier and Type | Method and Description |
---|---|
static String |
formatDate(Date obj)
Format a Date instance, using the
DEFAULT_DATE_FORMAT . |
Object |
getDefaultValue()
Returns the default value that was used to create this PropertyType.
|
Class<?> |
getTypeClass()
Gets the type class.
|
static PropertyType |
getTypeFor(Class<?> typeClass)
Returns the PropertyType based on a typeClass.
|
boolean |
isNodeOrEdge()
Returns true if this PropertyType is an edge or node type.
|
boolean |
isNumericType()
Returns true if this PropertyType is a numeric type.
|
static boolean |
parseBoolean(String input)
Parse boolean value from a string input.
|
static Date |
parseDate(String input)
Parse a string as Date, using the
DEFAULT_DATE_FORMAT . |
static PropertyType |
parsePropertyType(String input)
Parse PropertyType from a string value.
|
String |
toKey()
Returns the key of this type as string.
|
String |
toString()
Returns the key of this type as string.
|
static PropertyType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PropertyType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared.
|
public static final PropertyType BOOLEAN
public static final PropertyType DATE
public static final PropertyType DOUBLE
public static final PropertyType EDGE
public static final PropertyType FLOAT
public static final PropertyType INTEGER
public static final PropertyType LONG
public static final PropertyType LONG_SET
public static final PropertyType RO_STRING_SET
public static final PropertyType SPARSE
public static final PropertyType STRING
public static final PropertyType VERTEX
public static final SimpleDateFormat DEFAULT_DATE_FORMAT
public static String formatDate(Date obj)
DEFAULT_DATE_FORMAT
.obj
- Date instance to format.public Object getDefaultValue()
public Class<?> getTypeClass()
Type
getTypeClass
in interface Type
public static PropertyType getTypeFor(Class<?> typeClass)
typeClass
- Use this typeClass to derive the PropertyTypepublic boolean isNodeOrEdge()
public boolean isNumericType()
public static boolean parseBoolean(String input)
input
- String value to parse as boolean.public static Date parseDate(String input) throws GmParseException
DEFAULT_DATE_FORMAT
.input
- String value to parse as Date.GmParseException
public static PropertyType parsePropertyType(String input)
input
- Value to use to parse a PropertyType from. You can use the output of toString()
as input.public String toKey()
Type
public String toString()
toKey()
.toString
in class Enum<PropertyType>
public static PropertyType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static PropertyType[] values()
for (PropertyType c : PropertyType.values()) System.out.println(c);
Copyright © 2015. All rights reserved.